import request from '@/utils/request'

// 列表查询
export function listRes(query) {
  return request({
    url: '/system/res',
    method: 'get',
    params: query
  })
}
export function queryList(query){
  return request({
    url: '/system/res',
    method: 'get',
    params: query
  })
}


// 查询详细
export function getRes(resId) {
  return request({
    url: '/system/res/' + resId,
    method: 'get'
  })
}

export function queryOne(id){
  return request({
    url: '/system/res/' + id,
    method: 'get'
  })
}



// 新增菜单
export function addRes(data) {
  return request({
    url: '/system/res',
    method: 'post',
    data: data
  })
}

export function createOne(data){
  return request({
    url: '/system/res',
    method: 'post',
    data: data
  })
}

// 修改菜单
export function updateRes(data) {
  return request({
    url: '/system/res',
    method: 'put',
    data: data
  })
}

export function updateOne(data){
  return request({
    url: '/system/res',
    method: 'put',
    data: data
  })
}

// 删除菜单
export function delRes(resId) {
  return request({
    url: '/system/res/' + resId,
    method: 'delete'
  })
}

export function deleteOne(id){
  return request({
    url: '/system/res/' + id,
    method: 'delete'
  })
}

// 查询菜单下拉树结构
export function treeSelect() {
  return request({
    url: '/system/res/tree',
    method: 'get'
  })
}
